package com.ruoyi.flowable.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ruoyi.common.core.page.TableDataInfo;
import org.flowable.engine.runtime.ProcessInstance;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public interface IProcInstService {

    /**
     * @return org.flowable.engine.runtime.ProcessInstance
     * @desc 根据流程定义ID启动流程实例
     * @name startProcessInstanceById
     * @author zxw
     * @date 2022/12/13 11:15
     * @params [appVersionId, variables]
     */
    ProcessInstance startProcessInst(Long appVersionId, Map<String, Object> form) throws JsonProcessingException;

    /**
     * @return java.util.List<org.flowable.engine.history.HistoricProcessInstance>
     * @desc 获取我的发起
     * @name myProcInstList
     * @author zxw
     * @date 2022/12/13 10:50
     * @params [processName]
     */
    TableDataInfo myProcInstList(Integer pageNum, Integer pageSize, String processName);

    /**
     * 删除流程实例ID
     *
     * @param procInstId   流程实例ID
     * @param deleteReason 删除原因
     */
    void delete(String procInstId, String deleteReason);

    void exportPdf(String procInstId, HttpServletResponse response) throws Exception;
}
